<template>
	<view class="my-search-container" :style="{'background-color' : bgcolor}" @click="searchBoxhandle">
		<!-- 这是自定义的搜索组件 -->
		<view class="my-search-box" :style="{'border-radius' : radius + 'px'}">
			<uni-icons type="search" size="17"></uni-icons>
			<text class="placeholder">点击搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		props:{
		//背景颜色
			bgcolor:{
				type:String,
				default:'#26a886'
				},			// 圆角属性
			radius:{
				type:Number,
				default:20
			}
			
		},
		data() {
			return {
				
			};
		},
		methods:{
			searchBoxhandle(){
				// console.log(111)
				this.$emit('my-click')
			}
		}
	}
</script>

<style lang="scss">
.my-search-container {
	height: 60px;
	// background-color: #26a886;
	// text-align: center;
	// line-height: 60px;
	display: flex;
	align-items: center;
	padding: 0 20px;
	.my-search-box {
		width: 100%;
		height: 36px;
		background-color: #FFFFFF;
		// border-radius: 20px;
		display: flex;
		justify-content: center;
		align-items: center;
		.placeholder{
			font-size: 15px;
			margin-left: 5px;
		}
	} 
}
</style>
